package com.carleasoft.mps.forum.feign;

import com.carleasoft.mps.core.constant.ServiceNameConstants;
import com.carleasoft.mps.core.result.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * @author: yangHao
 * @createDate:2023/8/3
 * @description:
 */

@FeignClient(value = ServiceNameConstants.FILE_SERVER)
public interface RemoteFileService {

    /**
     * 根据文件id集合查询文件信息
     * @param ids
     * @return
     */
    @PostMapping("/fs/file/getFileList")
    public R<List<FileManage>> getFileList(@RequestBody List<String> ids);

    @PostMapping(value="/fs/file/upload", produces = {MediaType.APPLICATION_JSON_UTF8_VALUE}
            , consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    public R upload(@RequestPart("file") MultipartFile file);

}
